<?php 
	//---  获得post数据  ---
	$userID = $_REQUEST['UserID'];
	//－－－  连接服务器  －－－
	$con = mysql_connect("127.0.0.1:3306","root","1qazse4");
	$DataName = 'ShareNavigation';
	if(!$con)
	{
		die('无法连接远程服务器: '.mysql_error);
	}
	//－－－  链接指定数据库  －－－
	mysql_query("SET NAMES UTF8");
	mysql_select_db($DataName,$con);
	//－－－  查找好友  －－－
	$query = "SELECT Friend.FriendID AS UserID,
	UserTravel.UUID AS UUID,
	UserTravel.Location AS Location,
	UserTravel.Time AS Time,
	UserTravel.TravelSignature AS TravelSignature,
	User.HeadPhoto AS HeadPhoto,
	UserTravel.HasImage AS HasImage
	FROM Friend 
	INNER JOIN UserTravel ON Friend.FriendID = UserTravel.UserID 
	INNER JOIN User ON User.UserID = Friend.FriendID 
	WHERE Friend.UserID =  \"$userID\"  && Friend.IsAccept = 1  
	ORDER BY UserTravel.Time DESC";
	$result = mysql_query($query);
	if(!$result)
	{
		//---  查询出错   ----
		die('FALSE');
	}
	else 
	{
		echo '<body>' ;
		while($row = mysql_fetch_array($result))
  		{
			echo '<OneFriendTravel>';
			echo '<UUID>' . $row['UUID'] . '</UUID>';
			echo '<UserID>' .$row['UserID'].'</UserID>';
			echo '<HeadPhoto>' . $row['HeadPhoto'] . '</HeadPhoto>';
			echo '<Time>' . $row['Time'] . '</Time>';
			echo '<TravelSignature>' . $row['TravelSignature'] .'</TravelSignature>';
			echo '<Location>'.$row['Location'].'</Location>';
			echo '<HasImage>' .$row['HasImage'] .'</HasImage>';
			echo '</OneFriendTravel>';
 		}
		echo '</body>'; 	
	}
	
	mysql_close($con);
?>